package com.jzo2o.health.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.jzo2o.api.trade.dto.response.NativePayResDTO;
import com.jzo2o.api.trade.enums.PayChannelEnum;
import com.jzo2o.common.model.PageResult;
import com.jzo2o.health.model.domain.Orders;
import com.jzo2o.health.model.dto.request.OrdersCancelReqDTO;
import com.jzo2o.health.model.dto.request.OrdersPageQueryReqDTO;
import com.jzo2o.health.model.dto.request.PlaceOrderReqDTO;
import com.jzo2o.health.model.dto.response.*;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @Description IOrdersService
 * @Author liujiangyuan
 * @Date 2024-12-14-15:06
 */
public interface IOrdersService extends IService<Orders> {
    PlaceOrderResDTO placeOrder(PlaceOrderReqDTO placeOrderReqDTO);

    OrdersPayResDTO pay(Long id, PayChannelEnum tradingChannel);
    public void add(Orders orders);
    public void  updateorder(Long id, NativePayResDTO nativePayResDTO);

    OrdersPayResDTO payResult(Long id);
    void paySuccess(Long orderId, String transactionId, LocalDateTime payTime);

    void cancel(OrdersCancelReqDTO ordersCancelReqDTO);

    void refund(OrdersCancelReqDTO ordersCancelReqDTO);

    List<OrdersResDTO> pageQuery(Integer ordersStatus, Long sortBy);

    OrdersDetailResDTO detail(Long id);

    PageResult<OrdersResDTO> pageQueryadmin(OrdersPageQueryReqDTO ordersPageQueryReqDTO);

    AdminOrdersDetailResDTO aggregation(Long id);

    OrdersCountResDTO countByStatus();
}
